package util;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Collection;

public class Util {

	public static String readFileIntoString(String filepath) throws IOException
	{
		  BufferedReader br = new BufferedReader(new FileReader(filepath));
		    try {
		        StringBuilder sb = new StringBuilder();
		        String line = br.readLine();

		        while (line != null) {
		            sb.append(line);
		            sb.append(System.lineSeparator());
		            line = br.readLine();
		        }
		        String everything = sb.toString();
		        return everything;
		    } finally {
		        br.close();
		    }
	}
	
	public static String collectionToString(int[] array)
	{
		StringBuilder sb = new StringBuilder();
		for(int item : array)
		{
			sb.append(item);
			sb.append(" ");
		}
		return sb.toString();
	}
}
